<template>
	<view class="">
		<!-- <s-pull-scroll ref="pullScroll" :pullDown="pullDown" :pullUp="loadData" :back-top="true"> -->
			<view class="" style="padding-top: 30rpx;">
				<view class="item-con" v-for="(item, index) in dataList" :key="index" @tap.stop="onItemClick(item)">
					<view class="item">
						<view class="item-top-title clamp">{{ item.title }}</view>
						<!-- <view class="item-dir clamp2">{{item.introduction}}</view> -->
						<view class="item-dis clamp2">{{ item.address }}</view>
					</view>
				</view>
			</view>
		<!-- </s-pull-scroll> -->
		<mix-loading v-if="isLoading"></mix-loading>
	</view>
</template>

<script>
import QQMapWX from '@/common/js/qqmap-wx-jssdk.js';
const qqmapsdk = new QQMapWX({
	key: '54GBZ-BV3KX-72Q4C-77D5X-L6SAS-5DFVS'
});
export default {
	data() {
		return {
			keyword: '',
			dataList: []
		};
	},
	onLoad(options) {
		this.keyword = options.keyword;
		this.loadData();
	},
	methods: {
		onItemClick(item) {
			getApp().globalData.serverInfo = item;
			this.navTo('/pages_servce/servce/creat');
		},
		async loadData() {
			this.isLoading = true;
			qqmapsdk.search({
				keyword: this.keyword,
				page_size: 30,
				success: res => {
					console.log(res.count);
					if (res.status == 0) {
						this.dataList =res.data;
					}
				},
				fail:err=>{
					console.log(err)
				},
				complete: () => {
					this.isLoading = false;
				}
			});
		}
	}
};
</script>

<style scoped lang="scss">
.item-con {
	padding: 20rpx;
}
.item {
	border-radius: 20rpx;
	padding: 30rpx;
	background: #ffffff;
}
.item-dir {
	padding-top: 16rpx;
}
.item-dis {
	padding-top: 16rpx;
	font-size: 26rpx;
	color: #999;
}
</style>
